package view.console;

import java.util.ArrayList;
import java.util.Iterator;
import model.Genre;
import model.GenreModel;
import model.Model;

/**
 * Class for view a Genre-information 
 */
public class GenreView implements ItemView {

    private Model genres = new GenreModel();

    public Model getModel() {
        return genres;
    }

    public void showItems(ArrayList items) {
        if (items.size() == 0) {
            System.out.println("Не найдено ни одного жанра");
            return;
        }
        System.out.println("№\tЖанр");
        Iterator it = items.iterator();
        int i = 1;
        while (it.hasNext()) {
            System.out.println(i + "\t" + (Genre) it.next());
            i++;
        }
        System.out.println("--------------------------------------------------");
    }

}
